const Utils = require('./../utils/utils');

class Host {
  constructor (dao) {
    this.dao = dao;
  }

  query (params) {
    params = Utils.mergeObject({}, Utils.defaultQueryParameter, params);
    return Promise.all([this.dao.query(params), this.dao.count()])
      .then(result => {
        return result;
      }).catch(reason => {
        return reason;
      });
  }
}

module.exports = Host;
